/*
 * @(#) AttritionScene.java 	1.0 2010/9/30
 * 
 * Copyright 2010 guyven and David Croft. All rights reserved.
 */
package com.iawg.attrition.engine.renderer;

import com.ardor3d.annotation.MainThread;
import com.ardor3d.framework.Scene;
import com.ardor3d.framework.Updater;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.intersection.PickResults;
import com.ardor3d.math.Ray3;
import com.ardor3d.renderer.Renderer;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.util.ReadOnlyTimer;

/**
 * This class represent the state of all rendered objects on the parent canvas.
 * 
 * @author David Croft
 * @version 1.0 2010/9/30
 */
public class AttritionScene implements Scene, Updater{
	/** The root node for the entire scene. Every Object in the scene is attacked to this node. */
	private final Node root;
	/** The logical layer for the scene */
	private LogicalLayer logicalLayer;
	
	/** 
	 * Constructs a new scene to be rendered. 
	 * @param key 
	 * 
	 * @param logicalLayer
	 * */
	public AttritionScene() {
		root = new Node("root");
		logicalLayer = new LogicalLayer();
	}

	/** @return The root node for the entire scene. Every Object in the scene is attacked to this node. */
	public Node getRoot() {
		return root;
	}

	/**
	 * Will render the scene unto the given renderer.
	 * 
	 * @param renderer The renderer to render to.
	 * @return If the render was completed successfully.
	 */
	@MainThread
	@Override
	public boolean renderUnto(final Renderer renderer) {
		renderer.draw(root);
	    return true;
	}
	
	@Override
	public PickResults doPick(Ray3 pickRay) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Initializes this scene.
	 */
	@Override
	public void init() {
		// TODO Auto-generated method stub
		
	}

	/**
	 * Called every update frame.
	 */
	@Override
	public void update(ReadOnlyTimer timer) {
		
	}
}
